#include "ntddndis.h"
#include "nmapi.h"
#pragma once

#include "dumptcppayloaddoc.h"

class MyNetworkAnalyzer
{
	HANDLE myFrameParser;
	HANDLE myNplParser;
	HANDLE myFrameParserConfig;
	ULONG	myTCPPayloadLengthID;
	ULONG	myTCPSrcPortID;
	ULONG	myTCPDstPortID;
	ULONG	myTCPDataOffsetID;
	ULONG	myDisplayFilterID;
	ULONG	myConversationFilterID;
	ULONG	myIPv4SrcAddress;
	ULONG	myIPv4DstAddress;

	HANDLE	myCaptureFile;
	
	

	HANDLE MyLoadNPL(TCHAR* tszDisplayFilter,TCHAR* tszConversationFilter);
	
	void	UnLoadNPL(void)
	{
		NmCloseHandle(myNplParser);
		NmCloseHandle(myFrameParserConfig);
	}

public:
	MyNetworkAnalyzer(void);
public:
	~MyNetworkAnalyzer(void);
	void GetFramePayload(HANDLE myParsedFrame,HANDLE myRawFrame,TDumps& dumps);
	BOOL Init(const TCHAR *tszCapFile,TCHAR* tszDisplayFilter,TCHAR* tszConversationFilter,TDumps& dumps);
};
